<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../common/tagInclude.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<base href="${basePath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK href="${basePath}styleAdmin/css/portalinabox.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="${basePath}styleAdmin/js/prototype-1.6.0.3.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title>栏目Flash管理--修改</title>
<script type="text/javascript">
	function checkForm(){
		var errors = "" ;
		if($F('channelId') == "" ){
			errors += "栏目不能为空<br/>" ;
		}
		if($F('channelId') == "" ){
			errors += "语种不能为空<br/>" ;
		}
		var act = "${act}" ;
		if(act != 'update'){
			if($F('flashFile') == "" ){
				errors += "务必上传Flash<br/>" ;
			}
		}
		if(errors.length > 0){
			$('errors').innerHTML = "<font color='red' size='12'>" + errors  + "</font>" ;
			return ;
		}
		document.myform.submit();
	}
</script>
</head>
<body bottomMargin="0" leftMargin="0" rightMargin="0" topmargin="0">
<form name="myform" method="post" action="${basePath }admin/flash/${act}"  enctype="multipart/form-data">
<%@include file="../common/navigate.jsp" %>
<input type="hidden" id="flashId" name="flashId" value="${flashInfo.flashId}"/>
<table width="90%" border="0" align="center" cellPadding="0" cellSpacing="0" style="margin-top:5px;">
 <tr><td align="center" colspan="2"><div id="errors"></div></td></tr>
 <tr>
	<td vAlign="top" align="center" height="157">
		<table width="10" border="1" class="mainFunctionTable"  cellpadding="0" cellspacing="1">
        	<tr height="25" class="pLabel">
            	<td colspan="2" class="td_nwarpstyle" align="left">&nbsp;&nbsp;<c:choose><c:when test="${act == 'update'}">修改</c:when><c:otherwise>新增</c:otherwise></c:choose>栏目Flash</td>
            </tr>
			<tr>
         		<td align="center" width="10%">语言种类</td>
         		<td align="left">
         			<select name="languageId" id="languageId">
         				<option value="">请选择</option>
         				<c:forEach items="${languageInfoList }" var="languageInfo">
         					<option value="${languageInfo.id}" <c:if test="${languageInfo.id == flashInfo.languageId}">selected</c:if>>${languageInfo.name }</option>
         				</c:forEach>
         			</select>
         			&nbsp;&nbsp;<font color='red'>*</font>
         		</td>
    		 </tr>
			<tr>
         		<td align="center" width="10%">一级栏目</td>
         		<td align="left">
         			<select name="channelId"  id="channelId">
         				<option value="">请选择</option>
         				<c:forEach items="${channelInfoList }" var="channelInfo">
							<option value='${channelInfo.channelId}' <c:if test="${channelInfo.channelId == flashInfo.channelId}">selected</c:if>>${channelInfo.channelName}</option>
						</c:forEach>
         			</select>
         			&nbsp;&nbsp;<font color='red'>*</font>
         		</td>
    		 </tr>
			<tr>
         		<td align="center" width="10%">Flash名称</td>
         		<td align="left"><input type="text" name="flashName" id="flashName" value="${flashInfo.flashName}" width="120px"/></td>
    		</tr>
            <tr>
         		<td align="center" width="10%">Flash地址</td>
         		<c:choose>
         			<c:when test="${act == 'update'}"><td align="left"><input type="file" name="flashFile" id="flashFile"/>&nbsp;&nbsp;<a href="${flashInfo.flashPath}" target="_blank">查看</a></c:when>
         			<c:otherwise><td align="left"><input type="file" name="flashFile" id="flashFile"/>&nbsp;&nbsp;<font color='red'>*</font></td></c:otherwise>
         		</c:choose>
    		</tr>
            <tr align="left">
              <td align="center" colspan="2">
	              <a href="javascript:checkForm();"><img src="${basePath}styleAdmin/images/button/save.gif" border=0></a>
	              &nbsp;&nbsp;
	              <c:if test="${fmtString:isContainsInList('7030',userRightsSession) }">
			      	<a href="${basePath}admin/flash/list"><img src="${basePath}styleAdmin/images/button/exit.gif" border=0></a>
			      </c:if>
              </td>
            </tr>
          </table>
      </td>
  </tr>
</table>
</form>
</body>
</html>